package com.lhy.service.impl;


import java.sql.Timestamp;
import java.util.List;



import com.lhy.Dao.StudentMapper;
import com.lhy.domain.ApplyMsg;
import com.lhy.domain.Chat;
import com.lhy.domain.ChatTea;
import com.lhy.domain.Friend;
import com.lhy.domain.NewMessage;
import com.lhy.domain.ShopCart;
import com.lhy.domain.Student;
import com.lhy.domain.Tea;
import com.lhy.service.IUserService;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements IUserService {

	@Resource
	private StudentMapper userMapper;
	

	public Student selectByUserNameANDUserpwd(String username, String password) {
		
		return this.userMapper.selectByUsernameAndPassword(username, password);
	}

	
	public void insert(Student u) {
		this.userMapper.insert(u);
		
	}

	


	
	public Student queryStudentBySequence(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.selectByPrimaryKey(sequence);
	}


	public void saveChatTeaContent(Integer sequence, String nickname,
			String content) {
		// TODO Auto-generated method stub
		this.userMapper.saveChatTeaContent(sequence,nickname,content);
	}


	@Override
	public List<ChatTea> queryAllChatTea() {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllChatTea();
	}


	@Override
	public List<Tea> selectTeas() {
		// TODO Auto-generated method stub
		return this.userMapper.selectTeas();
	}


	@Override
	public Tea queryTeaByteaId(Integer teaId) {
		// TODO Auto-generated method stub
		return this.userMapper.queryTeaByteaId(teaId);
	}


	@Override
	public Integer queryAllChatTeaCount() {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllChatTeaCount();
	}


	@Override
	public List<ChatTea> queryChatTeaBypage(Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryChatTeaBypage(startIndex,endIndex);
	}




	@Override
	public void insertShoppingCart(Integer sequence, Integer teaId,
			String teaname, String teaimg, String url,Integer shopcartId) {
		// TODO Auto-generated method stub
		this.userMapper.insertShoppingCart(sequence, teaId,teaname,teaimg,url,shopcartId);
	}


	


	@Override
	public Integer queryAllShopCartCountBysequence(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllShopCartCountBysequence(sequence);
	}


	@Override
	public List<ShopCart> queryShopCartBySequencepage(Integer sequence,
			Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryShopCartBySequencepage(sequence,startIndex,endIndex);
	}


	@Override
	public void removeShopCart(Integer sequence, Integer shopcartId) {
		// TODO Auto-generated method stub
		this.userMapper.removeShopCart(sequence,shopcartId);
	}


	@Override
	public Tea queryTeaByteaname(String teaname) {
		// TODO Auto-generated method stub
		return this.userMapper.queryTeaByteaname(teaname);
	}


	@Override
	public Student selectByUserName(String username) {
		// TODO Auto-generated method stub
		return this.userMapper.selectByUserName(username);
	}


	@Override
	public void deleteOverdueChatTea() {
		// TODO Auto-generated method stub
		this.userMapper.deleteOverdueChatTea();
	}


	@Override
	public Integer queryAllFriendCount(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllFriendCount(sequence);
	}


	@Override
	public List<Friend> queryAllFriend(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllFriend(sequence);
	}


	@Override
	public Integer queryAllUserCountDeleteFriends(Integer sequence,
			Integer[] friendSequences) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllUserCountDeleteFriends(sequence,friendSequences);
	}


	@Override
	public List<Student> queryAllUserByPageDeleteFriends(Integer sequence,
			Integer[] friendSequences, Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllUserByPageDeleteFriends(sequence,friendSequences,startIndex,endIndex);
	}


	@Override
	public Integer queryAllUserCount(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllUserCount(sequence);
	}


	@Override
	public List<Student> queryAllUserByPage(Integer sequence,
			Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllUserByPage(sequence,startIndex,endIndex);
	}


	@Override
	public Student queryStudentByUsername(String username) {
		// TODO Auto-generated method stub
		return this.userMapper.queryStudentByUsername(username);
	}


	@Override
	public void findFriendApply(Integer valueOf, Integer userSequence,
			Integer userid, String nickname, String email, String phonenumber,
			String remark, String message, Timestamp create_dt, String sex,
			Integer state, String img) {
		// TODO Auto-generated method stub
		this.userMapper.findFriendApply(valueOf,userSequence,userid,nickname,email,phonenumber,remark,message,create_dt,sex,state,img);
	}


	@Override
	public Integer queryCountByUsername(String username) {
		// TODO Auto-generated method stub
		return this.userMapper.queryCountByUsername(username);
	}


	@Override
	public Integer selectCountByApplyMsg(Integer sequence) {
		// TODO Auto-generated method stub
		return this.userMapper.selectCountByApplyMsg(sequence);
	}


	@Override
	public List<ApplyMsg> selectApplyMsgByUsersequenceAndPage(Integer sequence,
			Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.selectApplyMsgByUsersequenceAndPage(sequence,startIndex,endIndex);
	}


	@Override
	public ApplyMsg selectApplyMsgByUsersequenceAndMsgsequence(
			Integer usersequence, Integer msgsequence) {
		// TODO Auto-generated method stub
		return this.userMapper.selectApplyMsgByUsersequenceAndMsgsequence(usersequence,msgsequence);
	}


	@Override
	public void insertFriend(Integer usersequence, Integer sequence, Integer userid, String nickname,
			String remark, String sex, String email, String phonenumber,String img) {
		this.userMapper.insertFriend(usersequence,sequence, userid, nickname, remark, sex, email, phonenumber,img);
		
	}


	@Override
	public void createChatTableBySequence(Integer sequence, Integer usersequence) {
		// TODO Auto-generated method stub
		this.userMapper.createChatTableBySequence(sequence, usersequence);
	}


	@Override
	public void deleteFriendApplyBySequence(Integer usersequence,
			Integer msgsequence) {
		// TODO Auto-generated method stub
		this.userMapper.deleteFriendApplyBySequence(usersequence,msgsequence);
	}


	@Override
	public List<Friend> queryAllFriendByPage(Integer sequence,
			Integer startIndex, Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllFriendByPage(sequence,startIndex,endIndex);
	}


	@Override
	public void deleteFriend(Integer usersequence, Integer sequence) {
		// TODO Auto-generated method stub
		this.userMapper.deleteFriend(usersequence,sequence);
	}


	@Override
	public void deleteChatTable(Integer count1, Integer count2) {
		// TODO Auto-generated method stub
		this.userMapper.deleteChatTable(count1,count2);
	}


	@Override
	public List<Chat> queryMessageBySequence(Integer sequence, Integer usersequence) {
		// TODO Auto-generated method stub
		return this.userMapper.queryMessageBySequence(sequence, usersequence);
	}


	@Override
	public void insertChatMessage(Integer count1, Integer count2,Integer usersequence, Integer sequence,
			String nickname, String remark, Timestamp create_dt, String message) {
		// TODO Auto-generated method stub
		this.userMapper.insertChatMessage(count1, count2, usersequence, sequence, nickname, remark, create_dt, message);
	}


	@Override
	public NewMessage queryNewMessageById(Integer newmessage_id) {
		// TODO Auto-generated method stub
		return this.userMapper.queryNewMessageById(newmessage_id);
	}


	@Override
	public void insertNewMessageByClob(String author, String title,
			String content, Timestamp create_dt, Integer sequence,Integer messageType) {
		// TODO Auto-generated method stub
		this.userMapper.insertNewMessageByClob(author, title,content, create_dt, sequence,messageType);
	}


	@Override
	public Integer queryAllNewMessageCount() {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllNewMessageCount();
	}


	@Override
	public List<NewMessage> queryAllNewMessageByPage(Integer startIndex,
			Integer endIndex) {
		// TODO Auto-generated method stub
		return this.userMapper.queryAllNewMessageByPage(startIndex,endIndex);
	}


	@Override
	public List<NewMessage> queryNewMessageList() {
		// TODO Auto-generated method stub
		return this.userMapper.queryNewMessageList();
	}


	@Override
	public List<NewMessage> queryNewMessageListByPd(String author,
			String title, String startTime, String endTime) {
		// TODO Auto-generated method stub
		return this.userMapper.queryNewMessageListByPd(author,title,startTime,endTime);
	}


	@Override
	public void deleteNewMessageByPd(Integer newmessage_id) {
		// TODO Auto-generated method stub
		this.userMapper.deleteNewMessageByPd(newmessage_id);
	}


	@Override
	public void updateNewMessage(String author, String title, String content,
			Timestamp create_dt, Integer newmenssage_id) {
		// TODO Auto-generated method stub
		this.userMapper.updateNewMessage(author,title,content,create_dt,newmenssage_id);
	}


	
	
}
